from django.contrib import admin
from .models import *


# Register your models here.

@admin.register(obs_project)
class ProjectAdmin(admin.ModelAdmin):
    search_fields = ['project_name']
    pass


@admin.register(obs_package)
class PackageAdmin(admin.ModelAdmin):
    search_fields = ['project__project_name', 'package_name']
    pass


@admin.register(obs_revision)
class RevisionAdmin(admin.ModelAdmin):
    search_fields = ['project__project_name', 'package__package_name']
    autocomplete_fields = ('project', 'package',)
    pass


@admin.register(obs_package_build_log)
class BuildLogAdmin(admin.ModelAdmin):
    autocomplete_fields = ('project', 'package',)
    search_fields = ['project__project_name', 'package__package_name']
    list_filter = ["status"]
    pass


@admin.register(obs_job_history)
class JobHistoryAdmin(admin.ModelAdmin):
    autocomplete_fields = ('project', 'package',)
    search_fields = ['project__project_name', 'package__package_name']
    list_filter = ["build_status_code"]
    pass
